<?php
/**
 * The html template file of index method of index module of zentaoPHP.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php
js::import($webRoot.'module/user/js/jquery.js');
js::import($webRoot.'module/user/js/zui.min.js');
js::import($webRoot.'module/user/js/zui.chart.min.js');?>
<style>
  .table-bordered td, .table-bordered th {
    border: 1px solid #989090 ! important;
  }
  .table>thead>tr>th{
    border: 1px solid #989090 ! important;
  }
  .panel{border: 1px solid #989090 ! important;}
  .dropdown-toggle{cursor: pointer;}
  .dropdown-menu li a{cursor: pointer;}
</style>
<div class="panel">
  <div class="panel-heading text-center">
    <strong>
      <span style="position: relative">
          <a class="dropdown-toggle nian" style="color: #333" data-toggle="dropdown" data-years="<?php echo $time;?>"> <?php echo $time.'年';?></a>
          <ul class="dropdown-menu checknian">
            <?php foreach($years as $key=>$val):?>
              <?php if($key<=$nowyears):?>
                <li><a data-years="<?php echo $key?>"><?php echo $val;?></a></li>
              <?php endif?>
            <?php endforeach?>
          </ul>
          </span>
      荔湾分局违规扣分统计表
    </strong>
  </div>
  <table class="table table-data table-bordered text-center table-fixedHeader">
    <thead>
    <tr class="text-center">
      <th>月份/分类</th>
      <?php foreach($category as $val) :?>
      <th><?php echo $val->mistake;?></th>
      <?php endforeach ?>
    </tr>
    </thead>
    <tbody>
    <tr>
      <td>一月</td>
      <?php foreach($data1 as $val1) :?>
      <td>
        <?php if($val1->sum) :?>
          <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val1->id}&start={$val1->startDate}&end={$val1->endDate}"),$val1->sum,"","data-toggle='modal' class='model'") ;?>
        <?php endif ?>
      </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>二月</td>
      <?php foreach($data2 as $val2) :?>
        <td>
          <?php if($val2->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val2->id}&start={$val2->startDate}&end={$val2->endDate}"),$val2->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>三月</td>
      <?php foreach($data3 as $val3) :?>
        <td>
          <?php if($val3->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val3->id}&start={$val3->startDate}&end={$val3->endDate}"),$val3->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>四月</td>
      <?php foreach($data4 as $val4) :?>
        <td>
          <?php if($val4->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val4->id}&start={$val4->startDate}&end={$val4->endDate}"),$val4->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>五月</td>
      <?php foreach($data5 as $val5) :?>
        <td>
          <?php if($val5->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val5->id}&start={$val5->startDate}&end={$val5->endDate}"),$val5->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>六月</td>
      <?php foreach($data6 as $val6) :?>
        <td>
          <?php if($val6->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val6->id}&start={$val6->startDate}&end={$val6->endDate}"),$val6->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>七月</td>
      <?php foreach($data7 as $val7) :?>
        <td>
          <?php if($val7->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val7->id}&start={$val7->startDate}&end={$val7->endDate}"),$val7->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>八月</td>
      <?php foreach($data8 as $val8) :?>
        <td>
          <?php if($val8->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val8->id}&start={$val8->startDate}&end={$val8->endDate}"),$val8->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>九月</td>
      <?php foreach($data9 as $val9) :?>
        <td>
          <?php if($val9->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val9->id}&start={$val9->startDate}&end={$val9->endDate}"),$val9->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>十月</td>
      <?php foreach($data10 as $val10) :?>
        <td>
          <?php if($val10->sum) :?>
          <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val10->id}&start={$val10->startDate}&end={$val10->endDate}"),$val10->sum,"","data-toggle='modal' class='model'") ;?>
       <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>十一月</td>
      <?php foreach($data11 as $val11) :?>
        <td>
          <?php if($val11->sum) :?>
          <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val11->id}&start={$val11->startDate}&end={$val11->endDate}"),$val11->sum,"","data-toggle='modal' class='model'") ;?>
        <?php endif ?>
          </td>
      <?php endforeach ?>
    </tr>
    <tr>
      <td>十二月</td>
      <?php foreach($data12 as $val12) :?>
        <td>
          <?php if($val12->sum) :?>
            <?php echo html::a($this->createLink('statistics', 'scategory', "pid={$val12->id}&start={$val12->startDate}&end={$val12->endDate}"),$val12->sum,"","data-toggle='modal' class='model'") ;?>
          <?php endif ?>
        </td>
      <?php endforeach ?>
    </tr>
    </tbody></table>
</div>
<script>
  $('.checknian').find('li').find('a').click(function(){
    $('.nian').text($(this).text());
    $('.nian').attr("data-years",$(this).attr("data-years"));
    var time = $(this).attr("data-years");
    var url = "/index.php?m=statistics&f=index&starttime="+time;
    window.location.href =url;
  })

</script>
<?php include '../../common/view/footer.html.php';?>
